<!DOCTYPE html>
<html>
    <head>
        <title> Find Road </title>
        <script src="{{ url_for("static",filename='js/jquery-3.4.1.js')}}"></script>
        <script>
            $(document).ready(function(){
                $("#roadkeys").keyup(function(){
                    roadkeys = $("#roadkeys").val();
                    $.post("/post/getTree", 
                    {roadkey:roadkeys}, function(recv){
                        $("#roadans").html(recv);
                    });
                });

                $('#roadans').change(function() {
                    var selectRoad = $('#roadans').find("option:selected").text()
                    $.post("/post/getTimeline",
                    {roadname:selectRoad}, function(recv){
                        $("#timeline").html(recv);
                    });
                });
            });
        </script>
    </head>
    <body>
        <h3>输入路段名字:</h3>
        <input type="text" id="roadkeys" />
        <h3>搜索结果:</h3>
        <div>
            <select id="roadans"></select>
        </div>
        <div id="timeline"></div>
    </body>
</html>
